<!DOCTYPE html>
<html lang="zh-CN" ng-app="app">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="广发证券股份有限公司">
    <meta content="telephone=no" name="format-detection">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="index.css" />
    <script type="text/javascript" src='angular.min.js'></script>
    <script type="text/javascript" src='index.js'></script>
    <title>后端测试</title>
  </head>
  <body ng-controller='AppController' ng-class="{hidden : !init}">
    <div class="loginContainer row" ng-show="!userInfo" form="">
      <a class="btn btn-primary" ng-href="{{loginUrl}}">登录</a>
    </div>

    <div class="loginContainer row" ng-show="userInfo">
      <div class="col-xs-5">
        <div class="input-group">
          <span class="input-group-addon">账号</span>
          <span class="form-control" ng-bind="userInfo.user.trade.khbh"></span>
        </div>
      </div>
      <div class="col-xs-5">
        <div class="input-group">
          <span class="input-group-addon">用户名</span>
          <span class="form-control" ng-bind="userInfo.display_name"></span>
        </div>
      </div>
      <div class="col-xs-2">
        <button type="button" class="btn btn-primary" ng-click="logout()">注销</button>
      </div>
    </div>

    <div class="restTestContainer">
      <div class="row">
        <div class="col-xs-8">
          <div class="input-group">
            <span class="input-group-addon">URL</span>
            <input class="form-control" placeholder="请求的地址" ng-model="request.url"></span>
          </div>
        </div>
        <div class="col-xs-2">
          <div class="btn-group methodSelect">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
              <span ng-bind='request.method'>test</span>
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
              <li><a href="javascript:;" ng-click="request.method = 'GET'">GET</a></li>
              <li><a href="javascript:;" ng-click="request.method = 'POST'">POST</a></li>
            </ul>
          </div>
          <!-- <select ng-model="request.method" ng-options='method for method in methodList'>
            <option value="">请选择HTTP请求类型</option>
          </select> -->
        </div>
        <div class="col-xs-2">
          <button type="button" class="btn btn-success send" ng-click="send()">发送</button>
        </div>
      </div>
      <div style="margin:15px 0">
        <textarea ng-show="request.method == 'POST'"  class="postData form-control" ng-model="request.data">
        </textarea>
      </div>
      <pre class="result" ng-bind="request.result" ng-show="request.result">
      </pre>
    </div>
    <div class="alert alert-danger" ng-bind="error" ng-show="error"></div>

  </body>
</html>